package com.stlm2.dems.entity.base;

import com.stlm2.dems.entity.*;

import java.math.BigDecimal;
import java.util.Date;

/**
 * Created by apple on 2017/10/19.
 */
public class BaseShopOrder {

    //唯一标识
    private Integer id;
    //订单编码
    private String code;
    //一级订单code
    private String purchaseOrderCode;
    //下单用户
    private Integer userId;
    //总金额
    private BigDecimal totalMoney;
    //支付金额
    private BigDecimal payMoney;
    //优惠金额
    private BigDecimal saveMoney;
    //创建时间
    private Date createTime;
    //取消时间
    private Date cancelTime;
    //取消原因
    private CancelReason cancelReason;
    //支付时间
    private Date payTime;
    //处理时间
    private Date handleTime;
    //处理人
    private Integer handlerId;
    //处理内容
    private String handleDetail;
    //就近店铺
    private Integer shopId;
    //发货人
    private Integer deliverId;
    //发货时间
    private Date deliverTime;
    //收货时间
    private Date receiptTime;
    //留言
    private String remark;
    //类型
    private Integer type;
    //物流公司
    private ExpressType expressType;
    //物流单号
    private String wayBillNum;
    //收货时间
    private Date receiptEndTime;
    //订单状态
    private OrderState orderState;
     // 支付方式
    private PayType payType;
     // 配送方式
    private DeliveryType deliveryType;
    //是否可以评价
    private Boolean hasComment;
    //购买增值服务个数
    private Integer serviceNum;
    //是否秒杀
    private Boolean seckill;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public BigDecimal getTotalMoney() {
        return totalMoney;
    }

    public void setTotalMoney(BigDecimal totalMoney) {
        this.totalMoney = totalMoney;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getCancelTime() {
        return cancelTime;
    }

    public void setCancelTime(Date cancelTime) {
        this.cancelTime = cancelTime;
    }

    public CancelReason getCancelReason() {
        return cancelReason;
    }

    public void setCancelReason(CancelReason cancelReason) {
        this.cancelReason = cancelReason;
    }

    public Date getPayTime() {
        return payTime;
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    public Date getHandleTime() {
        return handleTime;
    }

    public void setHandleTime(Date handleTime) {
        this.handleTime = handleTime;
    }

    public Integer getHandlerId() {
        return handlerId;
    }

    public void setHandlerId(Integer handlerId) {
        this.handlerId = handlerId;
    }

    public String getHandleDetail() {
        return handleDetail;
    }

    public void setHandleDetail(String handleDetail) {
        this.handleDetail = handleDetail;
    }

    public Integer getShopId() {
        return shopId;
    }

    public void setShopId(Integer shopId) {
        this.shopId = shopId;
    }

    public Integer getDeliverId() {
        return deliverId;
    }

    public void setDeliverId(Integer deliverId) {
        this.deliverId = deliverId;
    }

    public Date getDeliverTime() {
        return deliverTime;
    }

    public void setDeliverTime(Date deliverTime) {
        this.deliverTime = deliverTime;
    }

    public Date getReceiptTime() {
        return receiptTime;
    }

    public void setReceiptTime(Date receiptTime) {
        this.receiptTime = receiptTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public ExpressType getExpressType() {
        return expressType;
    }

    public void setExpressType(ExpressType expressType) {
        this.expressType = expressType;
    }

    public String getWayBillNum() {
        return wayBillNum;
    }

    public void setWayBillNum(String wayBillNum) {
        this.wayBillNum = wayBillNum;
    }

    public Date getReceiptEndTime() {
        return receiptEndTime;
    }

    public void setReceiptEndTime(Date receiptEndTime) {
        this.receiptEndTime = receiptEndTime;
    }

    public OrderState getOrderState() {
        return orderState;
    }

    public void setOrderState(OrderState orderState) {
        this.orderState = orderState;
    }

    public PayType getPayType() {
        return payType;
    }

    public void setPayType(PayType payType) {
        this.payType = payType;
    }

    public DeliveryType getDeliveryType() {
        return deliveryType;
    }

    public void setDeliveryType(DeliveryType deliveryType) {
        this.deliveryType = deliveryType;
    }

    public String getPurchaseOrderCode() {
        return purchaseOrderCode;
    }

    public void setPurchaseOrderCode(String purchaseOrderCode) {
        this.purchaseOrderCode = purchaseOrderCode;
    }

    public BigDecimal getPayMoney() {
        return payMoney;
    }

    public void setPayMoney(BigDecimal payMoney) {
        this.payMoney = payMoney;
    }

    public BigDecimal getSaveMoney() {
        return saveMoney;
    }

    public void setSaveMoney(BigDecimal saveMoney) {
        this.saveMoney = saveMoney;
    }

    public Boolean getHasComment() {
        return hasComment;
    }

    public void setHasComment(Boolean hasComment) {
        this.hasComment = hasComment;
    }

    public Integer getServiceNum() {
        return serviceNum;
    }

    public void setServiceNum(Integer serviceNum) {
        this.serviceNum = serviceNum;
    }

    public Boolean getSeckill() {
        return seckill;
    }

    public void setSeckill(Boolean seckill) {
        this.seckill = seckill;
    }

    /**
     * 快递公司
     * @return
     */
    public Integer getExpressTypeValue(){
        return (expressType != null) ? expressType.getIntValue() : null;
    }

    public void setExpressTypeValue(Integer v){
        if(v != null)
            expressType = ExpressType.getByIntValue(v);
    }


    /**
     * 订单状态
     * @return
     */
    public Integer getOrderStateValue(){
        return (orderState != null) ? orderState.getIntValue() : null;
    }

    public void setOrderStateValue(Integer v){
        if(v != null)
            orderState = OrderState.getByIntValue(v);
    }

    /**
     * 支付方式
     * @return
     */
    public Integer getPayTypeValue(){
        return (payType != null) ? payType.getIntValue() : null;
    }

    public void setPayTypeValue(Integer v){
        if(v != null)
            payType = PayType.getByIntValue(v);
    }

    /**
     * 配送方式
     * @return
     */
    public Integer getDeliveryTypeValue(){
        return (deliveryType != null) ? deliveryType.getIntValue() : null;
    }

    public void setDeliveryTypeValue(Integer v){
        if(v != null)
            deliveryType = DeliveryType.getByIntValue(v);
    }


    /*
      * 取消原因
      * */
    public void setCancelReasonValue(Integer cancelReasonValue){

        if( cancelReasonValue != null)
            cancelReason = CancelReason.getByIntValue(cancelReasonValue);
    }
    public Integer getCancelReasonValue(){
        return  (cancelReason!=null)? cancelReason.getIntValue() : null;
    }
}


